From 4d260b74be347b87399c9d8d45889d82207e228f Mon Sep 17 00:00:00 2001 From: Ell Date: Fri, 23 Jun 2017 07:30:40 -0400 Subject: [PATCH] palette: make the conversion hash table volatile ... to avoid the theoretical possiblity of hash table entires being read more than once during conversion, defying atomicity. Very, *very* paranoid, but what the hell :P --- babl/babl-palette.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/babl/babl-palette.c b/babl/babl-palette.c index 3c32601..ad90608 100644 --- a/babl/babl-palette.c +++ b/babl/babl-palette.c @@ -55,12 +55,14 @@ static double defpal_double[4*8*16]; typedef struct BablPalette { - int count; /* number of palette entries */ - const Babl *format;/* the pixel format the palette is stored in */ - unsigned char *data; /* one linear segment of all the pixels representing the palette, in order */ - double *data_double; - unsigned char *data_u8; - unsigned int hash[HASH_TABLE_SIZE]; + int count; /* number of palette entries */ + const Babl *format; /* the pixel format the palette is stored in */ + unsigned char *data; /* one linear segment of all the pixels + * representing the palette, in order + */ + double *data_double; + unsigned char *data_u8; + volatile unsigned int hash[HASH_TABLE_SIZE]; } BablPalette; static void -- 2.30.2